import java.util.Stack;
//用俩个栈实现队列
public class MyQueue {
    private Stack<Integer> s1=new Stack<>();
    private Stack<Integer> s2=new Stack<>();
    public  void push(int x){
        s1.push(x);

    }
    public  int pop(){
        if(empty()){
            return -1;
        }
        if(s2.empty()){
            while(!s1.empty()){
                s2.push(s1.pop());
            }
        }
        return s2.pop();

    }
    public  boolean empty(){
        return s1.empty()&&s2.empty();
    }
    public  int peek(){
        if(empty()){
            return -1;
        }
        if(s2.empty()){
            while(!s1.empty()){
                s2.push(s1.pop());
            }
        }
        return s2.peek();

    }
}
